package cn.example.demo.modules.house.dto;

import cn.example.demo.common.retrieval.BaseRequest;
import cn.example.demo.common.validation.groups.Batch;
import cn.example.demo.common.validation.groups.Delete;
import cn.example.demo.common.validation.groups.Insert;
import cn.example.demo.common.validation.groups.Update;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 描述：【房源】DTO
 */
@JsonIgnoreProperties(ignoreUnknown = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
public class HouseDto extends BaseRequest implements Serializable {
    private static final long serialVersionUID = 1L;

    @NotBlank(message = "ID不能为空！", groups = {Update.class})
    private String id;

    @NotEmpty(message = "房间标题不能为空！", groups = {Insert.class, Update.class})
    private String houseTitle;

    @NotEmpty(message = "地区不能为空！", groups = {Insert.class, Update.class})
    private String regionId;

    @NotEmpty(message = "具体位置不能为空！", groups = {Insert.class, Update.class})
    private String detailLocation;

    @NotEmpty(message = "房源类型不能为空！", groups = {Insert.class, Update.class})
    private String houseType;

    private String provide;

    private String detail;

    @NotNull(message = "单价/天不能为空！", groups = {Insert.class, Update.class})
    private BigDecimal cost;

    private BigDecimal discount;

    private String command;

    @NotNull(message = "房源状态不能为空！", groups = {Batch.class})
    private Integer houseStatus;

    @NotNull(message = "房源数量不能为空！", groups = {Insert.class, Update.class})
    private Integer inventory;

    private Integer organizationId;
    private Integer createUser;
    private String createUserName;
    private Date createTime;
    private Integer updateUser;
    private String updateUserName;
    private Date updateTime;

    private Date createTimeStart;
    private Date createTimeEnd;
    private Date updateTimeStart;
    private Date updateTimeEnd;

    private BigDecimal costStart;
    private BigDecimal costEnd;

    @NotEmpty(message = "IDs不能为空集！", groups = {Batch.class, Delete.class})
    private List<String> ids;

    private List<Integer> houseStatusList;

    //    @Valid
    private List<HouseImageDto> houseImages;    // 房间图片
}
